import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn } from 'typeorm';

@Entity()
export class User {
  @PrimaryGeneratedColumn('uuid')
  id!: string;

  @Column({ unique: true })
  username!: string;

  @Column()
  password!: string;

  @Column({ nullable: true })
  email!: string;

  @Column({ default: 'offline' })
  status!: string;

  @Column({ default: 'user' })
  role!: string;

  @Column('simple-array')
  permissions!: string[];

  @Column({ default: false })
  isVerified!: boolean;

  @Column({ nullable: true })
  lastLogin!: Date;

  @CreateDateColumn()
  createdAt!: Date;

  @UpdateDateColumn()
  updatedAt!: Date;
}
